home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / helpscre / helpscre.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-12-05  |  3.3 KB  |  111 lines

  1. VERSION 2.00
  2. Begin Form HelpScrn 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Help Screen"
  5.    ClientHeight    =   4200
  6.    ClientLeft      =   975
  7.    ClientTop       =   2100
  8.    ClientWidth     =   7575
  9.    Height          =   4605
  10.    Left            =   915
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   4200
  13.    ScaleWidth      =   7575
  14.    Top             =   1755
  15.    Width           =   7695
  16.    Begin ComboBox HelpTopic 
  17.       Height          =   300
  18.       Left            =   3120
  19.       TabIndex        =   0
  20.       Text            =   " "
  21.       Top             =   120
  22.       Width           =   4215
  23.    End
  24.    Begin CommandButton PrintHelp 
  25.       Caption         =   "Print Topic"
  26.       Height          =   255
  27.       Left            =   5760
  28.       TabIndex        =   2
  29.       Top             =   3720
  30.       Width           =   1575
  31.    End
  32.    Begin CommandButton Return 
  33.       Caption         =   "Return"
  34.       Height          =   255
  35.       Left            =   240
  36.       TabIndex        =   1
  37.       Top             =   3720
  38.       Width           =   1215
  39.    End
  40.    Begin TextBox DisplayHelp 
  41.       Height          =   3015
  42.       Left            =   240
  43.       MultiLine       =   -1  'True
  44.       ScrollBars      =   2  'Vertical
  45.       TabIndex        =   3
  46.       TabStop         =   0   'False
  47.       Text            =   " "
  48.       Top             =   600
  49.       Width           =   7095
  50.    End
  51. ' Helpscrn is a FREEWARE product.  While it is
  52. ' copywritten, you are encouraged to share it as
  53. ' long as you do not remove this message.
  54. ' HELPSCRN written by Ed Crygier (C)opyright 1992
  55. ' Requires Visual Basic version 2.0 to incorporate
  56. ' in your program or VBRUN200.DLL to use as a stand
  57. ' alone program.
  58. Dim IndexTopic(100) As String
  59. ' Number of Topics, Number of Lines per topic
  60. Dim HelpText(100, 55) As String
  61. Sub Form_Load ()
  62. NL$ = Chr$(13) + Chr$(10)   'sets a carraige return
  63. FileNum = FreeFile          ' find the next free file
  64. Open "HelpFile.Txt" For Input As FileNum  'the help text
  65. TopicNbr = 0                 ' initialize
  66. ReadARecord:
  67.  If EOF(FileNum) Then GoTo LeaveHere
  68.    TopicNbr = TopicNbr + 1
  69.    Line Input #FileNum, IndexTopic(TopicNbr)
  70.     X = InStr(" ", IndexTopic(TopicNbr))
  71.     HelpTopic.AddItem Mid$(IndexTopic(TopicNbr), X + 1, Len(IndexTopic(TopicNbr)) - X)
  72.    LineNbr = 0
  73. MoreLines:
  74.    LineNbr = LineNbr + 1
  75.    Line Input #FileNum, HelpText(TopicNbr, LineNbr)
  76.    If Left$(HelpText(TopicNbr, LineNbr), 1) = "#" Then
  77.       GoTo ReadARecord
  78.    Else
  79.     If Len(HelpText(TopicNbr, LineNbr)) = 0 Then GoTo LeaveHere
  80.     HelpText(TopicNbr, LineNbr) = HelpText(TopicNbr, LineNbr) + NL$
  81.     GoTo MoreLines
  82.    End If
  83. LeaveHere:
  84. Close #FileNum
  85.  HelpTopic.ListIndex = 0
  86. End Sub
  87. Sub HelpTopic_Click ()
  88.  ShowIt
  89. End Sub
  90. Sub PrintHelp_Click ()
  91. X = MsgBox("Insure printer is turned on.  OK to continue?", 36, "Print Topic")
  92. If X = 6 Then
  93.    Printer.Print IndexTopic(HelpTopic.ListIndex + 1)
  94.    Printer.Print DisplayHelp.Text
  95.    Printer.EndDoc
  96. End If
  97. End Sub
  98. Sub Return_Click ()
  99.  Unload HelpScrn
  100. End Sub
  101. Sub ShowIt ()
  102. y = HelpTopic.ListIndex + 1
  103. z = 0
  104. DisplayHelp.Text = ""
  105. ReadALine:
  106.   z = z + 1
  107.   If Left$(HelpText(y, z), 1) = "#" Then Exit Sub
  108.   DisplayHelp.Text = DisplayHelp.Text + HelpText(y, z)
  109. GoTo ReadALine
  110. End Sub
  111.